/**
 * Created by Administrator on 2017/3/8.
 */


module.exports = {
    INT32_MAX: 2147483647,

    rand: function(max) {
        return Math.floor(Math.random() * max);
    },

    randRange: function(from, to) {
        return from + Math.floor(Math.random() * (to - from + 1));
    },

    isSameArray: function(arr1, arr2) {
        if (arr1.length != arr2.length) {
            return false;
        }

        var isSame = true;
        for (var i = 0, l = arr1.length; i < l; ++i) {
            if (arr1[i] != arr2[i]) {
                isSame = false; break;
            }
        }

        return isSame;
    },
}